#ifndef __PATH_H__
#define __PATH_H__

#include "cAStar.h"
#include "cScene.h"

//Direction
#define N		1
#define S		2
#define E		3
#define O		4
#define NE		5
#define NO		6
#define SE		7
#define SO		8

//Going
#define STOP		0
#define CONTINUE	1
#define ARRIVE		2

//Step length
#define STEP_LENGTH	2	//Posible values = {1,2,4,8,16,32}


class cPath
{
	private:
		int x, y;		// actual cell
		int xf, yf;		// objective cell
		int nxf, nyf;	// new objective cell
		int dir;		// direction

		cAStar *AStar;
		cScene *mScene;

		void CalcDir(int x1, int y1, int x2, int y2);

	public:
		cPath(void);
		~cPath(void);

		void Make(cScene *scene, int cx, int cy, int cxdest, int cydest);	//Make new path
		void ReMake(cScene *scene, int cxdest, int cydest);					//Remake new path
		int  NextStep(int *px, int *py, int *cx, int *cy);					//Calculate next step position
		int  NextCell(void);												//Calculate next cell
		void GetDestinationCell(int *cxdest, int *cydest);
		int  Faced(void);
		bool IsDone(void);
		void Done(void);
};

#endif __PATH_H__